<template>
  <div>
    <el-form-item label="占位内容">
      <el-input
        v-model="data.placeholder"
        type="textarea"
        autosize
        clearable
        placeholder="占位内容"
      />
    </el-form-item>
    <el-form-item label="最大长度">
      <el-input-number
        v-model="data.maxlength"
        controls-position="right"
        placeholder="最大长度"
      />
    </el-form-item>
    <el-form-item label="显示计数">
      <el-switch v-model="data.showWordLimit" />
    </el-form-item>
    <el-form-item label="最小行">
      <el-input-number
        v-model="data.minRows"
        controls-position="right"
        placeholder="最小行"
        :min="1"
      />
    </el-form-item>
    <el-form-item label="最大行">
      <el-input-number
        v-model="data.maxRows"
        controls-position="right"
        placeholder="最大行"
        :min="2"
      />
    </el-form-item>
    <el-form-item label="自动数据">
      <el-switch v-model="data.autoData" />
    </el-form-item>
    <!-- 实际联合后端接口 -->
    <!-- <el-form-item v-if="data.autoData" label="接口地址">
      <el-input
        v-model="data.autoDataUrl"
        clearable
        placeholder="请输入接口地址"
      />
    </el-form-item>
    <el-form-item v-if="data.autoData" label="请求方法">
      <el-select
        v-model="data.dicMethod"
        placeholder="请求方法"
        size="small"
        style="width: 100%"
      >
        <el-option label="POST" value="post" />
        <el-option label="GET" value="get" />
      </el-select>
    </el-form-item>
    <el-form-item v-if="data.autoData" label="字段属性">
      <el-input
        v-model="data.autoDataKey"
        clearable
        placeholder="请输入返回数据对应属性"
      />
    </el-form-item> -->
    <!-- 演示用 -->
    <el-form-item v-if="data.autoData" label="字段属性">
      <el-select
        v-model="data.autoDataKey"
        placeholder="请选择字段属性"
        size="small"
        style="width: 100%"
      >
        <el-option
          v-for="(item, index) in autoOptions"
          :key="index"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
    </el-form-item>
  </div>
</template>

<script>
  export default {
    name: 'ConfigTextarea',
    props: ['data'],
    data() {
      return {
        autoOptions: [
          {
            label: '用户名称',
            value: 'userName',
          },
          {
            label: '项目名称',
            value: 'orgName',
          },
          {
            label: '项目编码',
            value: 'projectCode',
          },
          {
            label: '项目经理',
            value: 'fprojectmanager',
          }
        ],
      }
    },
  }
</script>
